<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>二叉树 | 数据结构与算法（Python）</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../chapter7/section2.html" />
    
    
    <link rel="prev" href="../chapter7/index.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="7.1"
        data-chapter-title="二叉树"
        data-filepath="chapter7/section1.md"
        data-basepath=".."
        data-revision="Tue May 23 2017 16:07:52 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        数据结构与算法（Python）
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="chapter1/index.html">
            
                
                    <a href="../chapter1/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        引入概念
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="chapter1/section1.html">
            
                
                    <a href="../chapter1/section1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        第一次尝试
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="chapter1/section2.html">
            
                
                    <a href="../chapter1/section2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        算法的提出
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="chapter1/section3.html">
            
                
                    <a href="../chapter1/section3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        第二次尝试
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="chapter1/section4.html">
            
                
                    <a href="../chapter1/section4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        算法效率衡量
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="chapter1/section5.html">
            
                
                    <a href="../chapter1/section5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        算法分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="chapter1/section6.html">
            
                
                    <a href="../chapter1/section6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        常见时间复杂度
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="chapter1/section7.html">
            
                
                    <a href="../chapter1/section7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        Python内置类型性能分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="chapter1/section8.html">
            
                
                    <a href="../chapter1/section8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        数据结构
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="chapter2/index.html">
            
                
                    <a href="../chapter2/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        顺序表
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="chapter2/section1.html">
            
                
                    <a href="../chapter2/section1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        顺序表的形式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="chapter2/section2.html">
            
                
                    <a href="../chapter2/section2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        顺序表的结构与实现
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="chapter2/section3.html">
            
                
                    <a href="../chapter2/section3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        顺序表的操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="chapter2/section4.html">
            
                
                    <a href="../chapter2/section4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        Python中的顺序表
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="chapter3/index.html">
            
                
                    <a href="../chapter3/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        链表
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="chapter3/section1.html">
            
                
                    <a href="../chapter3/section1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        单向链表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="chapter3/section3.html">
            
                
                    <a href="../chapter3/section3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        双向链表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="chapter3/section2.html">
            
                
                    <a href="../chapter3/section2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        单向循环链表
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="chapter4/index.html">
            
                
                    <a href="../chapter4/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        栈
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="chapter4/section1.html">
            
                
                    <a href="../chapter4/section1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        栈结构实现
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="chapter5/index.html">
            
                
                    <a href="../chapter5/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        队列
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="chapter5/section1.html">
            
                
                    <a href="../chapter5/section1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        队列的实现
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="chapter5/section3.html">
            
                
                    <a href="../chapter5/section3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        双端队列
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="chapter6/index.html">
            
                
                    <a href="../chapter6/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        排序与搜索
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="chapter6/section1.html">
            
                
                    <a href="../chapter6/section1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        冒泡排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="chapter6/section2.html">
            
                
                    <a href="../chapter6/section2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        选择排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="chapter6/section3.html">
            
                
                    <a href="../chapter6/section3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        插入排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="chapter6/section4.html">
            
                
                    <a href="../chapter6/section4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        快速排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="chapter6/section5.html">
            
                
                    <a href="../chapter6/section5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        希尔排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="chapter6/section6.html">
            
                
                    <a href="../chapter6/section6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        归并排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="chapter6/section7.html">
            
                
                    <a href="../chapter6/section7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        常见排序算法效率比较
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.8" data-path="chapter6/section8.html">
            
                
                    <a href="../chapter6/section8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.8.</b>
                        
                        搜索
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="chapter7/index.html">
            
                
                    <a href="../chapter7/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        树与树算法
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="7.1" data-path="chapter7/section1.html">
            
                
                    <a href="../chapter7/section1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        二叉树
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="chapter7/section2.html">
            
                
                    <a href="../chapter7/section2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        二叉树的遍历
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >数据结构与算法（Python）</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x4E8C;&#x53C9;&#x6811;">&#x4E8C;&#x53C9;&#x6811;</h1>
<h2 id="&#x4E8C;&#x53C9;&#x6811;&#x7684;&#x57FA;&#x672C;&#x6982;&#x5FF5;">&#x4E8C;&#x53C9;&#x6811;&#x7684;&#x57FA;&#x672C;&#x6982;&#x5FF5;</h2>
<p>&#x4E8C;&#x53C9;&#x6811;&#x662F;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x6700;&#x591A;&#x6709;&#x4E24;&#x4E2A;&#x5B50;&#x6811;&#x7684;&#x6811;&#x7ED3;&#x6784;&#x3002;&#x901A;&#x5E38;&#x5B50;&#x6811;&#x88AB;&#x79F0;&#x4F5C;&#x201C;&#x5DE6;&#x5B50;&#x6811;&#x201D;&#xFF08;left subtree&#xFF09;&#x548C;&#x201C;&#x53F3;&#x5B50;&#x6811;&#x201D;&#xFF08;right subtree&#xFF09;  </p>
<h2 id="&#x4E8C;&#x53C9;&#x6811;&#x7684;&#x6027;&#x8D28;&#x7279;&#x6027;">&#x4E8C;&#x53C9;&#x6811;&#x7684;&#x6027;&#x8D28;(&#x7279;&#x6027;)</h2>
<p><strong>&#x6027;&#x8D28;1:</strong> &#x5728;&#x4E8C;&#x53C9;&#x6811;&#x7684;&#x7B2C;i&#x5C42;&#x4E0A;&#x81F3;&#x591A;&#x6709;2^(i-1)&#x4E2A;&#x7ED3;&#x70B9;&#xFF08;i&gt;0&#xFF09;<br><strong>&#x6027;&#x8D28;2:</strong> &#x6DF1;&#x5EA6;&#x4E3A;k&#x7684;&#x4E8C;&#x53C9;&#x6811;&#x81F3;&#x591A;&#x6709;2^k - 1&#x4E2A;&#x7ED3;&#x70B9;&#xFF08;k&gt;0&#xFF09;<br><strong>&#x6027;&#x8D28;3:</strong> &#x5BF9;&#x4E8E;&#x4EFB;&#x610F;&#x4E00;&#x68F5;&#x4E8C;&#x53C9;&#x6811;&#xFF0C;&#x5982;&#x679C;&#x5176;&#x53F6;&#x7ED3;&#x70B9;&#x6570;&#x4E3A;N0&#xFF0C;&#x800C;&#x5EA6;&#x6570;&#x4E3A;2&#x7684;&#x7ED3;&#x70B9;&#x603B;&#x6570;&#x4E3A;N2&#xFF0C;&#x5219;N0=N2+1;<br><strong>&#x6027;&#x8D28;4:</strong>&#x5177;&#x6709;n&#x4E2A;&#x7ED3;&#x70B9;&#x7684;&#x5B8C;&#x5168;&#x4E8C;&#x53C9;&#x6811;&#x7684;&#x6DF1;&#x5EA6;&#x5FC5;&#x4E3A; log2(n+1)<br><strong>&#x6027;&#x8D28;5:</strong>&#x5BF9;&#x5B8C;&#x5168;&#x4E8C;&#x53C9;&#x6811;&#xFF0C;&#x82E5;&#x4ECE;&#x4E0A;&#x81F3;&#x4E0B;&#x3001;&#x4ECE;&#x5DE6;&#x81F3;&#x53F3;&#x7F16;&#x53F7;&#xFF0C;&#x5219;&#x7F16;&#x53F7;&#x4E3A;i &#x7684;&#x7ED3;&#x70B9;&#xFF0C;&#x5176;&#x5DE6;&#x5B69;&#x5B50;&#x7F16;&#x53F7;&#x5FC5;&#x4E3A;2i&#xFF0C;&#x5176;&#x53F3;&#x5B69;&#x5B50;&#x7F16;&#x53F7;&#x5FC5;&#x4E3A;2i&#xFF0B;1&#xFF1B;&#x5176;&#x53CC;&#x4EB2;&#x7684;&#x7F16;&#x53F7;&#x5FC5;&#x4E3A;i/2&#xFF08;i&#xFF1D;1 &#x65F6;&#x4E3A;&#x6839;,&#x9664;&#x5916;&#xFF09;</p>
<blockquote>
<p>(1)&#x5B8C;&#x5168;&#x4E8C;&#x53C9;&#x6811;&#x2014;&#x2014;&#x82E5;&#x8BBE;&#x4E8C;&#x53C9;&#x6811;&#x7684;&#x9AD8;&#x5EA6;&#x4E3A;h&#xFF0C;&#x9664;&#x7B2C; h &#x5C42;&#x5916;&#xFF0C;&#x5176;&#x5B83;&#x5404;&#x5C42; (1&#xFF5E;h-1) &#x7684;&#x7ED3;&#x70B9;&#x6570;&#x90FD;&#x8FBE;&#x5230;&#x6700;&#x5927;&#x4E2A;&#x6570;&#xFF0C;&#x7B2C;h&#x5C42;&#x6709;&#x53F6;&#x5B50;&#x7ED3;&#x70B9;&#xFF0C;&#x5E76;&#x4E14;&#x53F6;&#x5B50;&#x7ED3;&#x70B9;&#x90FD;&#x662F;&#x4ECE;&#x5DE6;&#x5230;&#x53F3;&#x4F9D;&#x6B21;&#x6392;&#x5E03;&#xFF0C;&#x8FD9;&#x5C31;&#x662F;&#x5B8C;&#x5168;&#x4E8C;&#x53C9;&#x6811;&#x3002;<br><img src="../images/&#x5B8C;&#x5168;&#x4E8C;&#x53C9;&#x6811;.png" alt="&#x5B8C;&#x5168;&#x4E8C;&#x53C9;&#x6811;"></p>
</blockquote>
<p>(2)&#x6EE1;&#x4E8C;&#x53C9;&#x6811;&#x2014;&#x2014;&#x9664;&#x4E86;&#x53F6;&#x7ED3;&#x70B9;&#x5916;&#x6BCF;&#x4E00;&#x4E2A;&#x7ED3;&#x70B9;&#x90FD;&#x6709;&#x5DE6;&#x53F3;&#x5B50;&#x53F6;&#x4E14;&#x53F6;&#x5B50;&#x7ED3;&#x70B9;&#x90FD;&#x5904;&#x5728;&#x6700;&#x5E95;&#x5C42;&#x7684;&#x4E8C;&#x53C9;&#x6811;&#x3002;<br><img src="../images/&#x6EE1;&#x4E8C;&#x53C9;&#x6811;.png" alt="&#x6EE1;&#x4E8C;&#x53C9;&#x6811;"></p>
<h2 id="&#x4E8C;&#x53C9;&#x6811;&#x7684;&#x8282;&#x70B9;&#x8868;&#x793A;&#x4EE5;&#x53CA;&#x6811;&#x7684;&#x521B;&#x5EFA;">&#x4E8C;&#x53C9;&#x6811;&#x7684;&#x8282;&#x70B9;&#x8868;&#x793A;&#x4EE5;&#x53CA;&#x6811;&#x7684;&#x521B;&#x5EFA;</h2>
<p>&#x901A;&#x8FC7;&#x4F7F;&#x7528;Node&#x7C7B;&#x4E2D;&#x5B9A;&#x4E49;&#x4E09;&#x4E2A;&#x5C5E;&#x6027;&#xFF0C;&#x5206;&#x522B;&#x4E3A;elem&#x672C;&#x8EAB;&#x7684;&#x503C;&#xFF0C;&#x8FD8;&#x6709;lchild&#x5DE6;&#x5B69;&#x5B50;&#x548C;rchild&#x53F3;&#x5B69;&#x5B50;</p>
<pre><code class="lang-python"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Node</span><span class="hljs-params">(object)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;&#x8282;&#x70B9;&#x7C7B;&quot;&quot;&quot;</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self, elem=-<span class="hljs-number">1</span>, lchild=None, rchild=None)</span>:</span>
        self.elem = elem
        self.lchild = lchild
        self.rchild = rchild
</code></pre>
<p>&#x6811;&#x7684;&#x521B;&#x5EFA;,&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6811;&#x7684;&#x7C7B;&#xFF0C;&#x5E76;&#x7ED9;&#x4E00;&#x4E2A;root&#x6839;&#x8282;&#x70B9;&#xFF0C;&#x4E00;&#x5F00;&#x59CB;&#x4E3A;&#x7A7A;&#xFF0C;&#x968F;&#x540E;&#x6DFB;&#x52A0;&#x8282;&#x70B9;</p>
<pre><code class="lang-python"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Tree</span><span class="hljs-params">(object)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;&#x6811;&#x7C7B;&quot;&quot;&quot;</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self, root=None)</span>:</span>
        self.root = root

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">add</span><span class="hljs-params">(self, elem)</span>:</span>
        <span class="hljs-string">&quot;&quot;&quot;&#x4E3A;&#x6811;&#x6DFB;&#x52A0;&#x8282;&#x70B9;&quot;&quot;&quot;</span>
        node = Node(elem)
        <span class="hljs-comment">#&#x5982;&#x679C;&#x6811;&#x662F;&#x7A7A;&#x7684;&#xFF0C;&#x5219;&#x5BF9;&#x6839;&#x8282;&#x70B9;&#x8D4B;&#x503C;</span>
        <span class="hljs-keyword">if</span> self.root == <span class="hljs-keyword">None</span>:
            self.root = node
        <span class="hljs-keyword">else</span>:
            queue = []
            queue.append(self.root)
            <span class="hljs-comment">#&#x5BF9;&#x5DF2;&#x6709;&#x7684;&#x8282;&#x70B9;&#x8FDB;&#x884C;&#x5C42;&#x6B21;&#x904D;&#x5386;</span>
            <span class="hljs-keyword">while</span> queue:
                <span class="hljs-comment">#&#x5F39;&#x51FA;&#x961F;&#x5217;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;</span>
                cur = queue.pop(<span class="hljs-number">0</span>)
                <span class="hljs-keyword">if</span> cur.lchild == <span class="hljs-keyword">None</span>:
                    cur.lchild = node
                    <span class="hljs-keyword">return</span>
                <span class="hljs-keyword">elif</span> cur.rchild == <span class="hljs-keyword">None</span>:
                    cur.rchild = node
                    <span class="hljs-keyword">return</span>
                <span class="hljs-keyword">else</span>:
                    <span class="hljs-comment">#&#x5982;&#x679C;&#x5DE6;&#x53F3;&#x5B50;&#x6811;&#x90FD;&#x4E0D;&#x4E3A;&#x7A7A;&#xFF0C;&#x52A0;&#x5165;&#x961F;&#x5217;&#x7EE7;&#x7EED;&#x5224;&#x65AD;</span>
                    queue.append(cur.lchild)
                    queue.append(cur.rchild)
</code></pre>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../chapter7/index.html" class="navigation navigation-prev " aria-label="Previous page: 树与树算法"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../chapter7/section2.html" class="navigation navigation-next " aria-label="Next page: 二叉树的遍历"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
